#!/bin/sh -x

# The old script to create boot image - not used anymore

# import variables
. scripts/vars.sh

# check if we have all the directories we need
if [ ! -d ${GYPSY_CDDIR} ]; then
	mkdir -p ${GYPSY_CDDIR}
fi

cd ${GYPSY_CDDIR}
mkdir -p boot bin dev lib libexec sbin
cp -r ${GYPSY_WORLDDIR}/boot/* boot/
cat > boot/loader.conf << _EOF
vfs.root.mountfrom="cd9660:/dev/iso9660/GYPSY"
vfs.root.mountfrom.options="ro"
_EOF

# copy only necessary files to get us to boot and execute /etc/rc
cp ${GYPSY_WORLDDIR}/sbin/init sbin/
cp ${GYPSY_WORLDDIR}/etc/login.conf etc/
cp ${GYPSY_WORLDDIR}/etc/rc etc/
cp ${GYPSY_WORLDDIR}/bin/sh bin/
cp ${GYPSY_WORLDDIR}/lib/libc.so.7 lib/
cp ${GYPSY_WORLDDIR}/lib/libedit.so.6 lib/
cp ${GYPSY_WORLDDIR}/lib/libncurses.so.7 lib/
cp ${GYPSY_WORLDDIR}/libexec/ld-elf.so.1 libexec/

#mv ${UZIP_FS} boot
